package y23.Jun;

import java.util.Scanner;

//写一个函数返回参数二进制中1的个数
public class Test7 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int num = sc.nextInt();
            int n = 0;
            while(num > 0){
                n *= 10;
                n += num % 2;
                num /= 2;
            }
            System.out.println(n);
            int count = 0;
            while(n > 0){
                if(n % 10 == 1){
                    count++;
                }
                n /= 10;
            }
            System.out.println(count);
        }
    }
}
